#!/bin/bash


(
    set -e 
    cd "$(dirname "$0")"

    proj="."

    # git -C "$proj" checkout v1.15.3

    image="inthbl/ssl-gen"


    sudo docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
    sudo docker buildx create --name multiarch-builder --driver docker-container --use || true
    sudo docker buildx inspect --bootstrap


    sudo docker buildx build --push --platform=linux/amd64,linux/arm64,linux/arm/v7 \
      -f "$proj/Dockerfile" -t $image \
      "$proj"

)
